#include "../callback.h"
#include "../netfwd.h"

class FirstItf : public CallbackObject
{
public:
	virtual ~FirstItf() throw()
	{}
	
	virtual int32_t on_callback( int32_t code, void * data ) = 0;
};

class Second : public FirstItf
{
public:
	virtual ~Second() throw()
	{
		set_handler( this, &Second::on_callback );
	}
	
	virtual int32_t on_callback( int32_t code, void * data )
	{
		debug_output( "invoke on_callback %d", code );
		return 0;
	}
};

int32_t main( int32_t argc, char * argv[] )
{
	FirstItf * first = new Second();
	first->on_callback( 1, 0 );
	
	CallbackObject * cb = static_cast<CallbackObject>( first );
	cb->handle_event( 9, 0 );
	
	delete first;
	return 0;
}


